#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 迭代
from collections import Iterable
from collections import Iterator
tList = list(range(5))
for i in tList:
    if isinstance(tList, Iterable):
        print(i)
for i, v in enumerate(tList):
    print(i, v)
tDict = {"a": 1, "b": 2, "c": 3}
for j in tDict:
    print(j)
for m in tDict.values():
    print(m)
for n in tDict.items():
    print(n)
for k, v in tDict.items():
    print(k, v)
tStr = "我们都是新中国的接班人"
for x in tStr:
    print(x)
# 迭代器
ge = (str(x) + m + n for x in range(10) if x %
      2 == 0 for m in 'ABCDE' for n in 'XYZMN')
if isinstance(ge, Iterator):
    print("是迭代器")
else:
    print("不是迭代器")
if isinstance(tList, Iterator):
    print("是迭代器")
else:
    print("不是迭代器")
if isinstance(iter(tList), Iterator):
    print("是迭代器")
else:
    print("不是迭代器")
